from kunlun import lib

# 获取事件日志接口
log = lib.get_event_logger()


def setup():
    log.info("it is setup")
    lib.set_display1("机型: 1234567890123456")
    lib.set_display2("料号: 1234567890123456")
    lib.set_display3("Slot ID: 1234567890123456")
    uut = lib.conn.REF
    uut.open()


def teardown():
    log.info("it is teardown")
    uut = lib.conn.REF
    uut.close()


# 定义入口函数, 每个文件只有一个入口函数。
def main_sequence():
    # 增加一个根测试序列sequence，并设置名称为MAIN SEQ
    seq = lib.get_sequence_definition("MAIN SEQ")
    seq.add_step(setup, name="setup")
    seq.add_step(teardown, name="teardown")

    return seq
